<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定时器</title>
</head>

<body>
  <script>
    let timer = setInterval(function () {
      document.write('老妹' + '<br>')
    }, 1000)
    clearInterval(timer)
  </script>
</body>

</html>